/*  ----------------------------------------------------------------------------
 *  Arello Mobile
 *  Fast 3d Engine
 *  ----------------------------------------------------------------------------
 * Except where otherwise noted, this work is licensed under
 * http://creativecommons.org/licenses/by/3.0
 */

#include "Event.h"

namespace liba
{
namespace input
{

	Event::Event( const std::string & hardware_name, const std::string & key_name, bool pressed, double time )
:	hardware_name( hardware_name ),
	key_name( key_name ),
	state( pressed ? PRESS : RELEASE ),
	time( time )
{}

Event::Event(const std::string & hardware_name, const std::wstring & text, double time )
:	hardware_name( hardware_name ),
	text( text ),
	state( TEXT ),
	time( time )
{
}

Event::Event( const std::string & hardware_name, const std::string & key_name, double value, double time  )
:	hardware_name( hardware_name ),
	key_name( key_name ),
	value( value ),
	time( time )
{
}

void Event::change_info(const std::string & new_hardware_name, const std::string & new_key_name )
{
	hardware_name = new_hardware_name;
	key_name = new_key_name;
}

bool Event::operator==(const Event & event)const
{
	return hardware_name == event.hardware_name && key_name == event.key_name;
}

} // namespace input
} // namespace liba


